﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Binding and Unbinding Events with jQuery</title>
    <script type="text/javascript" src="../jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(function() {
            $("#evtTarget").hover(highlight, highlight);

            $("#evtTarget").toggle(fnClick1, fnClick2);
        });
        
        function highlight(evt) {
            $("#evtTarget").toggleClass("highlighted");
        }
        function fnClick1() {
            $("#evtTarget").html("Click!");
        }
        function fnClick2() {
            $("#evtTarget").html("Clack!");
        }
    </script>
    <style type='text/css'>
    .normal {
        width:300px;
        height:200px;
        background-color:Yellow;
        font-size:18pt;
    }
    
    .highlighted {
        background-color:Red;
    }
    </style>
</head>
<body>
<h1>Using Event Helpers</h1>
<div id="evtTarget" class="normal">Mouse over this div to see the effect. Click on it to change the content.</div>
</body>
</html>
